home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 3 / Light ROM 3 - Disc 2.iso / programs / amiga / macromkr / adpromac.lha / $FREAK.adpro < prev    next >
Text File  |  1993-07-27  |  3KB  |  121 lines

  1. /*
  2.         THIS MACRO PROCESSES AN IMAGE SEQUENCE TO LOOK LIKE A MOVING
  3.         FRESCO.    WRITTEN BY DANIEL H. BERNARD 
  4.                    COPYRITE 1993
  5.  
  6. */
  7.  
  8.  
  9.  
  10.  
  11. address "ADPro"
  12.  
  13. options results
  14. GETFILE '"Name of Sequence"' 'EH0:'
  15. TheFile = adpro_result
  16. np = index(TheFile,"000")
  17. say np
  18. TheFile = left(TheFile,np-1)
  19.  
  20. getnumber '"Number of Frames To Process"' 1 1 9999
  21. nof=adpro_result
  22.  
  23. SFORMAT "IFF" 
  24.  
  25. DO fn = 1 TO nof
  26.  
  27. if fn < 10 then LoadFile = Thefile||"000"||fn
  28. else if fn > 9 & fn < 100 then LoadFile = TheFile||"00"||fn
  29. else LoadFile = TheFile||"0"||fn
  30. say loadfile
  31. lformat "UNIVERSAL"
  32. load LoadFile
  33.  
  34.  
  35.  
  36. OFORMAT
  37. oldOp = ADPRO_RESULT
  38.  
  39. IF( ~EXISTS( "adpro:convolutions/WoodCut" )) THEN DO
  40.         ADPRO_TO_FRONT
  41.         OKAY1 "The convolution WoodCut," || NL ||,
  42.                 "cannot be found."
  43.         EXIT 10
  44. END
  45.  
  46. IMAGE_TYPE
  47. ImageType = ADPRO_RESULT
  48. IF( WORD( ImageType, 1 ) = "NONE" ) THEN DO
  49.         ADPRO_TO_FRONT
  50.         OKAY1 "There is currently no image" || NL ||,
  51.                 "in ADPro's buffer. An image" || NL ||,
  52.                 "is required for this operator."
  53.         EXIT 10
  54. END
  55.  
  56. IF( WORD( ImageType, 1 ) = "BITPLANE" ) THEN DO
  57.         /*
  58.         ** There's no raw data, but there is rendered data.
  59.         ** The user must want us to modify the rendered data.
  60.         */
  61.  
  62.         OPERATOR "RENDERED_TO_RAW"
  63.         IF( RC ~= 0 ) THEN DO
  64.                 ADPRO_TO_FRONT
  65.                 OKAY1 "Converting rendered to raw failed."
  66.                 OFORMAT oldOp
  67.                 EXIT 10
  68.         END
  69. END
  70.  
  71. /*
  72. ** Fresco the image.
  73. */
  74.  
  75. DO 
  76.         OPERATOR "BLUR" 0 0
  77.  
  78.     IF( RC ~= 0 ) THEN DO
  79.                 ADPRO_TO_FRONT
  80.                 OKAY1 "The operator BLUR," || NL ||,
  81.                         "failed to execute."
  82.                 OFORMAT oldOp
  83.                 EXIT 10
  84.         END
  85.                OPERATOR "DISPLACE_PIXEL" 2 100 0
  86.  
  87.         IF( RC ~= 0 ) THEN DO
  88.                 ADPRO_TO_FRONT
  89.                 OKAY1 "The operator DISPLACE_PIXEL," || NL ||,
  90.                         "failed to execute."
  91.                 OFORMAT oldOp
  92.                 EXIT 10
  93.         END
  94.  
  95.         OPERATOR "MEDIAN_FILTER" 0
  96.         IF( RC ~= 0 ) THEN DO
  97.                 ADPRO_TO_FRONT
  98.                 OKAY1 "The operator MEDIAN_FILTER," || NL ||,
  99.                         "failed to execute."
  100.                 OFORMAT oldOp
  101.                 EXIT 10
  102.         END
  103.  
  104. END
  105.  
  106. OPERATOR "CONVOLVE" "adpro:convolutions/WoodCut" 100 0
  107. IF( RC ~= 0 ) THEN DO
  108.         ADPRO_TO_FRONT
  109.         OKAY1 "The operator CONVOLVE," || NL ||,
  110.                 "failed to execute."
  111.         OFORMAT oldOp
  112.         EXIT 10
  113. END
  114.  
  115. OFORMAT oldOp
  116.  
  117. SAVE Loadfile "RAW"
  118. END
  119.  
  120. exit
  121.